//
// Created by jsjxsy on 2022/8/12.
//
#include <iostream>
using namespace std;

class CAverage {
 public:
  double operator()(int a1, int a2, int a3) {  //重载()运算符
    return (double) (a1 + a2 + a3) / 3;
  }
};

int add(int a = 1, int b = 2) {
  return a + b;
}

int main() {
  CAverage average;  //能够求三个整数平均数的函数对象
  cout << average(3, 2, 3);  //等价于 cout << average.operator(3, 2, 3);
  int result = add();
  cout << "result=" << result << endl;
  return 0;
}
